/**
 * 原数组 arr，期待处理成如下格式 arr2
 */
let arr2 = [
  { from: 'txt', name: 'xiaoli' },
  { from: 'txt2', name: 'xiaoli2' },
]

let arr = [
  {
    param: [{ from: 'txt' }, { name: 'xiaoli' }],
  },
  {
    param: [{ from: 'txt2' }, { name: 'xiaoli2' }],
  },
]

// todo
let result = arr.reduce((res, prev) => {
  let obj = {}
  if (prev.param) {
    prev.param.forEach(item => (obj = { ...obj, ...item }))
    res.push(obj)
  }
  return res
}, [])

console.log(result)
